package com.erp.entity.purchase;

import com.erp.entity.goods.GoodsPriceStrategy;
import com.erp.entity.goods.MultipleUnit;
import com.erp.entity.goods.Unit;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @author :qinya
 * @PackageName:com.erp.entity.purchase
 * @ClassName: PurchaseOrderDetail
 * @Description: TODO
 * @date : 2025/7/11,15:48
 */
public class PurchaseOrderDetail {

    private Integer purchaseOrderDetailId; // 购货单明细表ID（主键，自增）
    private String purchaseOrderCode;      // 购货订单编号（关联主表）
    private String goodsCode;              // 商品编号
    private Integer warehouseId;           // 仓库ID
    private Integer quantity;              // 数量
    private Integer multipleUnitId;           // 多单位ID（外键，关联单位表）
    private Integer singleUnitId;                 // 单位ID（外键，关联单位表）
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date deliveryDate;             // 交货日期
    private BigDecimal purchasePrice;      // 购货单价（Decimal类型，避免浮点精度问题）
    private Integer discountRate;          // 折扣率（百分比，如10代表10%）
    private Integer rate;                  // 税率（百分比，如13代表13%）
    private String remark;                 // 备注
    private Integer unStockedQuantity;     // 未入库数量
    private Integer isGift;                // 是否为赠品（数据库存储0/1，映射为Boolean）
    private Integer companyId;              // 公司ID
    private Integer purchasePreOrderDetailId; // 购货订单明细表ID（外键，关联预购货单明细表）
    private String purchasePreOrderCode; // 购货订单明细表ID（外键，关联预购货单明细表）
    private Integer comparePriceDetailId;// 比价单明细ID

    // 冗余购货订单字段
    private Integer availableQuantity; // 如果是从购货订单选的商品有最大数量限制

    // 冗余单据日期字段
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date invoiceDate; // 单据日期

    // 冗余商品字段
    private String goodsName; // 商品名称
    private String multipleUnitName; // 多单位名称
    private Integer basicUnitId; // 基本单位ID
    private String basicUnitName; // 基本单位名称
    private String singleUnitName; // 单单位名称
    private String goodsSpecification; // 商品规格
    private String brandName; // 商品品牌
    private String imgMainUrl; // 商品主图路径
    private String goodsRemark; // 商品备注
    private Integer basicQuantity; // 基本数量
    private List<MultipleUnit> multipleUnitList; // 多单位列表
    private Unit unit; // 单单位
    private List<GoodsPriceStrategy> goodsPriceStrategies; // 价格策略列表

    // 冗余退货数量字段
    private Integer returnQuantity; // 退货数量

    // 冗余质检详情id
    private Integer qualityCheckId; // 质检单详情id
    private String qualityCheckCode; // 质检单编号

    public String getQualityCheckCode() {
        return qualityCheckCode;
    }

    public void setQualityCheckCode(String qualityCheckCode) {
        this.qualityCheckCode = qualityCheckCode;
    }

    public Integer getPurchaseOrderDetailId() {
        return purchaseOrderDetailId;
    }


    public void setPurchaseOrderDetailId(Integer purchaseOrderDetailId) {
        this.purchaseOrderDetailId = purchaseOrderDetailId;
    }

    public String getPurchaseOrderCode() {
        return purchaseOrderCode;
    }

    public void setPurchaseOrderCode(String purchaseOrderCode) {
        this.purchaseOrderCode = purchaseOrderCode;
    }

    public String getGoodsCode() {
        return goodsCode;
    }

    public void setGoodsCode(String goodsCode) {
        this.goodsCode = goodsCode;
    }

    public Integer getWarehouseId() {
        return warehouseId;
    }

    public void setWarehouseId(Integer warehouseId) {
        this.warehouseId = warehouseId;
    }

    public Integer getQuantity() {
        return quantity;
    }

    public void setQuantity(Integer quantity) {
        this.quantity = quantity;
    }

    public Integer getMultipleUnitId() {
        return multipleUnitId;
    }

    public void setMultipleUnitId(Integer multipleUnitId) {
        this.multipleUnitId = multipleUnitId;
    }

    public Integer getSingleUnitId() {
        return singleUnitId;
    }

    public void setSingleUnitId(Integer singleUnitId) {
        this.singleUnitId = singleUnitId;
    }

    public Date getDeliveryDate() {
        return deliveryDate;
    }

    public void setDeliveryDate(Date deliveryDate) {
        this.deliveryDate = deliveryDate;
    }

    public BigDecimal getPurchasePrice() {
        return purchasePrice;
    }

    public void setPurchasePrice(BigDecimal purchasePrice) {
        this.purchasePrice = purchasePrice;
    }

    public Integer getDiscountRate() {
        return discountRate;
    }

    public void setDiscountRate(Integer discountRate) {
        this.discountRate = discountRate;
    }

    public Integer getRate() {
        return rate;
    }

    public void setRate(Integer rate) {
        this.rate = rate;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getUnStockedQuantity() {
        return unStockedQuantity;
    }

    public void setUnStockedQuantity(Integer unStockedQuantity) {
        this.unStockedQuantity = unStockedQuantity;
    }

    public Integer getIsGift() {
        return isGift;
    }

    public void setIsGift(Integer isGift) {
        this.isGift = isGift;
    }

    public Integer getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Integer companyId) {
        this.companyId = companyId;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public String getMultipleUnitName() {
        return multipleUnitName;
    }

    public void setMultipleUnitName(String multipleUnitName) {
        this.multipleUnitName = multipleUnitName;
    }

    public String getSingleUnitName() {
        return singleUnitName;
    }

    public void setSingleUnitName(String singleUnitName) {
        this.singleUnitName = singleUnitName;
    }

    public Integer getPurchasePreOrderDetailId() {
        return purchasePreOrderDetailId;
    }

    public void setPurchasePreOrderDetailId(Integer purchasePreOrderDetailId) {
        this.purchasePreOrderDetailId = purchasePreOrderDetailId;
    }

    public String getPurchasePreOrderCode() {
        return purchasePreOrderCode;
    }

    public void setPurchasePreOrderCode(String purchasePreOrderCode) {
        this.purchasePreOrderCode = purchasePreOrderCode;
    }

    public Integer getBasicUnitId() {
        return basicUnitId;
    }

    public void setBasicUnitId(Integer basicUnitId) {
        this.basicUnitId = basicUnitId;
    }

    public String getBasicUnitName() {
        return basicUnitName;
    }

    public void setBasicUnitName(String basicUnitName) {
        this.basicUnitName = basicUnitName;
    }

    public String getGoodsSpecification() {
        return goodsSpecification;
    }

    public void setGoodsSpecification(String goodsSpecification) {
        this.goodsSpecification = goodsSpecification;
    }

    public String getBrandName() {
        return brandName;
    }

    public void setBrandName(String brandName) {
        this.brandName = brandName;
    }

    public String getImgMainUrl() {
        return imgMainUrl;
    }

    public void setImgMainUrl(String imgMainUrl) {
        this.imgMainUrl = imgMainUrl;
    }

    public String getGoodsRemark() {
        return goodsRemark;
    }

    public void setGoodsRemark(String goodsRemark) {
        this.goodsRemark = goodsRemark;
    }

    public Integer getBasicQuantity() {
        return basicQuantity;
    }

    public void setBasicQuantity(Integer basicQuantity) {
        this.basicQuantity = basicQuantity;
    }

    public List<MultipleUnit> getMultipleUnitList() {
        return multipleUnitList;
    }

    public void setMultipleUnitList(List<MultipleUnit> multipleUnitList) {
        this.multipleUnitList = multipleUnitList;
    }

    public Unit getUnit() {
        return unit;
    }

    public void setUnit(Unit unit) {
        this.unit = unit;
    }

    public List<GoodsPriceStrategy> getGoodsPriceStrategies() {
        return goodsPriceStrategies;
    }

    public void setGoodsPriceStrategies(List<GoodsPriceStrategy> goodsPriceStrategies) {
        this.goodsPriceStrategies = goodsPriceStrategies;
    }

    public Integer getAvailableQuantity() {
        return availableQuantity;
    }

    public void setAvailableQuantity(Integer availableQuantity) {
        this.availableQuantity = availableQuantity;
    }

    public Date getInvoiceDate() {
        return invoiceDate;
    }

    public void setInvoiceDate(Date invoiceDate) {
        this.invoiceDate = invoiceDate;
    }

    public Integer getReturnQuantity() {
        return returnQuantity;
    }

    public void setReturnQuantity(Integer returnQuantity) {
        this.returnQuantity = returnQuantity;
    }

    public Integer getComparePriceDetailId() {
        return comparePriceDetailId;
    }

    public void setComparePriceDetailId(Integer comparePriceDetailId) {
        this.comparePriceDetailId = comparePriceDetailId;
    }

    public Integer getQualityCheckId() {
        return qualityCheckId;
    }

    public void setQualityCheckId(Integer qualityCheckId) {
        this.qualityCheckId = qualityCheckId;
    }
}
